[v8] RFC-0045: Stack management#3687
Conversation
Signed-off-by: Simon Jones <simonjones@vmware.com>
Signed-off-by: Simon Jones <simonjones@vmware.com>
Signed-off-by: Simon Jones <simonjones@vmware.com>
Signed-off-by: Simon Jones <simonjones@vmware.com>
Signed-off-by: Simon Jones <simonjones@vmware.com>
Signed-off-by: Simon Jones <simonjones@vmware.com>
Signed-off-by: Simon Jones <simonjones@vmware.com>
Signed-off-by: Simon Jones <simonjones@vmware.com>
vuil
left a comment
There was a problem hiding this comment.
Thanks for the changes. I added a couple of minor suggestions. I assume this needs to wait till the cloud-controller changes are merged?
rashedkvm
left a comment
There was a problem hiding this comment.
Just a reminder to update the minimum API version prior to merging. Much appreciated!
| {"env", "set-env", "unset-env"}, | ||
| {"stacks", "stack"}, | ||
| {"copy-source", "create-app-manifest"}, | ||
| {"env", "set-env", "unset-env"}, |
| fakeActor.GetStackByNameReturns(stack, v7action.Warnings{}, nil) | ||
| }) | ||
|
|
||
| It("Displays the stack information without state", func() { |
There was a problem hiding this comment.
Thanks for addressing the comments here.
nit: it's odd I am not seeing the issue on the github page, but when I checked out the branch, it is showing this It("Displays... block is misindented by one fewer level. Same is true the next It(Displays.. block
| Context("when state values are provided in different cases", func() { | ||
| It("accepts 'active' and capitalizes it", func() { | ||
| cmd.State = "active" | ||
| fakeActor.GetStackByNameReturns(resources.Stack{GUID: "guid"}, v7action.Warnings{}, nil) | ||
| fakeActor.UpdateStackReturns(resources.Stack{Name: "some-stack", State: resources.StackStateActive}, v7action.Warnings{}, nil) | ||
|
|
||
| executeErr = cmd.Execute(args) | ||
|
|
||
| Expect(executeErr).ToNot(HaveOccurred()) | ||
| _, state := fakeActor.UpdateStackArgsForCall(0) | ||
| Expect(state).To(Equal(resources.StackStateActive)) | ||
| }) | ||
|
|
||
| It("accepts 'RESTRICTED' and keeps it capitalized", func() { | ||
| cmd.State = "RESTRICTED" | ||
| fakeActor.GetStackByNameReturns(resources.Stack{GUID: "guid"}, v7action.Warnings{}, nil) | ||
| fakeActor.UpdateStackReturns(resources.Stack{Name: "some-stack", State: resources.StackStateRestricted}, v7action.Warnings{}, nil) | ||
|
|
||
| executeErr = cmd.Execute(args) | ||
|
|
||
| Expect(executeErr).ToNot(HaveOccurred()) | ||
| _, state := fakeActor.UpdateStackArgsForCall(0) | ||
| Expect(state).To(Equal(resources.StackStateRestricted)) | ||
| }) | ||
|
|
||
| It("accepts 'Disabled' and capitalizes it", func() { | ||
| cmd.State = "Disabled" | ||
| fakeActor.GetStackByNameReturns(resources.Stack{GUID: "guid"}, v7action.Warnings{}, nil) | ||
| fakeActor.UpdateStackReturns(resources.Stack{Name: "some-stack", State: resources.StackStateDisabled}, v7action.Warnings{}, nil) | ||
|
|
||
| executeErr = cmd.Execute(args) | ||
|
|
||
| Expect(executeErr).ToNot(HaveOccurred()) | ||
| _, state := fakeActor.UpdateStackArgsForCall(0) | ||
| Expect(state).To(Equal(resources.StackStateDisabled)) | ||
| }) | ||
| }) |
There was a problem hiding this comment.
Nit: did you mean to have this block be a child context of "Context("When the environment is setup correctly" ? Probably doesn't matter either way but if it is meant to be, then its indent is a little off.
| } | ||
|
|
||
| // ValidStackStatesString returns a pipe-separated string of valid states in lowercase | ||
| func ValidStackStatesString() string { |
Thank you for contributing to the CF CLI! Please read the following:
If your contribution falls under a company CLA but your membership is not public, expect delays while we confirm.
Note: Please create separate PR for every branch (main and v8) as needed.
Description of the Change
This PR covers the CLI implementation details for RFC-0045: Enhance Stack Handling in Cloud Foundry. It adds an additional state field to output of the
cf stack,cf stacks&cf update-stackcommands, as well as adding the ability to modify the state to thecf update-stackcommand. This is a partner PR to the existing Cloud Controller changes submitted for reviewWhy Is This PR Valuable?
These changes will be required for consumers to interact with the new features available in the Cloud Controller, the RFC has been accepted, indicating the changes are valuable.
Applicable Issues
N/A
How Urgent Is The Change?
This should be accepted and released in line with the changes being proposed to the Cloud Controller
Other Relevant Parties
The Cloud Controller changes linked above should detail other people impacted.